#!/bin/csh
#
#  Sample Batch Script for a titan cluster job
#
#  Submit this script using the command: qsub
#
#  Use the "qstat" command to check the status of a job.
#
# The following are embedded QSUB options. The syntax is #PBS (the # does
# _not_  denote that the lines are commented out so do not remove).
#
# resource limits  walltime: maximum wall clock time (hh:mm:ss)
#                  nodes: number of 2-processor nodes
#                  ppn: how many processors per node to use (1 or 2)
#                      (you are always charged for the entire node)
#                  prod: production titan cluster nodes
#PBS -l walltime=12:00:00,nodes=4:ppn=2:prod
#
# queue name
#PBS -q standard
#
# export all my environment variables to the job
#PBS -V
#
# job name (default = name of script file)
#PBS -N nt_1
#
# filename for standard output (default = <job_name>.o<job_id>)
#PBS -o net_test_1.out
#
# filename for standard error (default = <job_name>.e<job_id>)
#PBS -o net_test_1.err
#
# send mail when the job begins and ends (optional)
#PBS -m be
# End of embedded QSUB options

#set echo               # echo commands before execution; use for debugging

# Create the scratch directory for the job and cd to it
setenv SCR `set_SCR`

# go to scratch directory
if ($SCR != "") cd $SCR

mkdir $PBS_JOBID       # make subdirectory based on jobID and
cd $PBS_JOBID          # cd to this directory

# get relevant enzo files from home directory
cp /u/ac/bwoshea/mncp/64grid/Grid* .
cp /u/ac/bwoshea/mncp/64grid/Part* .
cp /u/ac/bwoshea/mncp/net_test.ics .

cp /u/ac/bwoshea/enzo-code/bin/enzo .
cp /u/ac/bwoshea/E8.6/amr_mpi/exe/cool_rates.in .
cp /u/ac/bwoshea/E8.6/amr_mpi/exe/ATOMIC.DAT .
cp /u/ac/bwoshea/enzo-lca/ring/ring .

# run ring and enzo
vmirun "ring ParticlePositions ParticleVelocities"
vmirun "enzo -d net_test.ics > net_test_1.log"
